import de.greenrobot.daogenerator.DaoGenerator;
import de.greenrobot.daogenerator.Entity;
import de.greenrobot.daogenerator.Schema;

public class PojoGenerator {

	public static void main(String[] args) throws Exception {

		Schema schema = new Schema(3, "com.greenDao.pojo");

		Entity movie = schema.addEntity("Movie");
		movie.addIdProperty().primaryKey().index().autoincrement();
		movie.addStringProperty("title").notNull();
		movie.addIntProperty("year");
		movie.addStringProperty("director");
		movie.addDoubleProperty("rate");

		Entity event = schema.addEntity("Event");
		event.addIdProperty().primaryKey().index().autoincrement();
		event.addStringProperty("name").notNull();
		event.addDateProperty("time");
		event.addStringProperty("comment");
		event.addToOne(movie, event.addLongProperty("movieId").notNull().getProperty());

		new DaoGenerator().generateAll(schema, "../greenDao/src-gen");
	}
}